package com.yang.system.domain.orgMng.org;

import com.yang.system.domain.orgMng.orgType.OrgTypeStatus;

public enum OrgStatus {
    EFFECTIVE("生效中", 1),
    TERMINATING("终止中", 2),
    CANCELLED("撤销",3 );

    private final String description; // 描述
    private final int code; // 状态码

    // 构造函数
    OrgStatus(String description, int code) {
        this.description = description;
        this.code = code;
    }

    // 获取描述
    public String getDescription() {
        return description;
    }

    // 获取状态码
    public int getCode() {
        return code;
    }

    // 根据状态码获取枚举实例
    public static OrgStatus getByCode(int code) {
        return OrgTypeStatus.getByCode(code);
    }

    @Override
    public String toString() {
        return this.description;
    }

}
